import { ref } from 'vue'
import { defineStore } from 'pinia'

export const useUserStore = defineStore('user', () => {
  const login = ref(false);
  const tokenId = ref("");

  // 当前用户是否已经登录
  function isLogin() {
    return login.value;
  };

  // 退出
  function logout() {
    login.value = false;
    tokenId.value = "";
  }

  return { login, tokenId, isLogin, logout };
})
